/**
 * 
 */
package com.eagle.coders.security.beans;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * @author Anees
 *
 */
@Entity
@Table(name ="eagle_levels")
@SequenceGenerator(name="lvl_eagle_seq", sequenceName="eagle_gen_seq")
public class LevelsBean implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private Integer id;
	
	private String levelCode;
	
	private List<RolesBean> rolesBeans;
	
	private String description;

	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue(generator="lvl_eagle_seq", strategy=GenerationType.SEQUENCE)
	public Integer getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the levelCode
	 */
	@Column(name = "level_cd")
	public String getLevelCode() {
		return levelCode;
	}

	/**
	 * @param levelCode the levelCode to set
	 */
	public void setLevelCode(String levelCode) {
		this.levelCode = levelCode;
	}

	/**
	 * @return the rolesBeans
	 */
	@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	public List<RolesBean> getRolesBeans() {
		return rolesBeans;
	}

	/**
	 * @param rolesBeans the rolesBeans to set
	 */
	public void setRolesBeans(List<RolesBean> rolesBeans) {
		this.rolesBeans = rolesBeans;
	}

	/**
	 * @return the description
	 */
	@Column(name = "description", length = 100)
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}
}
